﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
    class Scolarite
    {
        # region var
        public int  Id { get; set; }
        public string Nom { get; set; }        
        public string Prenom { get; set; }
        public int  Cin { get; set; }
        public string Num_tel { get; set; }
        public string Email { get; set; }
        public Authentification authentificationScolarit { get; set; }

        

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Scolarite GetScolariteById(int id)
        {
            return sqlScolarite.GetScolariteById(id);
        }


        public static int deleteScolarite(int id, int idAuthent)
        {
            return sqlScolarite.deletScolarite(id, idAuthent);
        }


        public static int SaveScolarite(Scolarite s)
        {
            int nbRow;
            if ((nbRow = sqlScolarite.updateScolarite(s)) > 0)
                return nbRow;
            else
                return sqlScolarite.insertScolarite(s);
        }
    }
        #endregion
}
